package com.jt.www.dao.mapper.insprerecord;


import com.jt.www.dao.BaseMapper;
import com.jt.www.model.insprerecord.InsPreRecordEntity;
import com.jt.www.model.insprerecord.vo.InsPreParamVO;
import com.jt.www.model.insprerecord.vo.InsPreRecordExportVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface InsPreRecordEntityMapper extends BaseMapper<InsPreRecordEntity> {

    @Select("SELECT `id`,`user_code`,`user_name`,`create_user_code`, `product_code`, `product_name`,`status`,`start_date`, `end_date`, `create_time` FROM `t_ins_pre_record`  " +
            " WHERE (user_code = #{userCode} OR create_user_code = #{userCode})  order by create_time DESC")
    @Results({
            @Result(property = "id", column = "id"),
            @Result(property = "userCode", column = "user_code"),
            @Result(property = "userName", column = "user_name"),
            @Result(property = "createUserCode", column = "create_user_code"),
            @Result(property = "productCode", column = "product_code"),
            @Result(property = "productName", column = "product_name"),
            @Result(property = "status", column = "status"),
            @Result(property = "startDate", column = "start_date"),
            @Result(property = "endDate", column = "end_date"),
            @Result(property = "createTime", column = "create_time"),
    })
    List<InsPreRecordEntity> selectListNOContent(@Param("userCode") String userCode);


    List<InsPreRecordEntity> getInsPreRecordList(@Param("userCode") String userCode, @Param("productName") String productName);

    List<InsPreRecordExportVO> exportList(@Param("insPreParamVO") InsPreParamVO insPreParamVO);
}